package br.museu.dao.generico;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import br.museu.dao.basic.UsuarioDAO;
import br.museu.dao.basic.intefaces.IEventoDAO;
import br.museu.dao.basic.intefaces.ITicketDAO;
import br.museu.dao.basic.intefaces.IUsuarioDAO;

@Repository
public abstract class DAOFactory {

	@Autowired
	private static SessionFactory sessionFactory;

	@Autowired
	private static IUsuarioDAO usuarioDAO;

	@Autowired
	private static IEventoDAO eventoDAO;

	@Autowired
	private static ITicketDAO ticketDAO;

	public static Session getCurrentSession() {
		return sessionFactory.getCurrentSession();
	}

	public static IUsuarioDAO getUsuarioDAO() {
		usuarioDAO = new UsuarioDAO();
		return usuarioDAO;
	}

}
